package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="system_setting" )
public class SystemSetting extends BaseObject implements Serializable {
    private Long settingId;
    private String data;
    private String name;
    private Long time;
    private Long typeId;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getSettingId() {
        return this.settingId;
    }
    
    public void setSettingId(Long settingId) {
        this.settingId = settingId;
    }
    
    @Column(name="data", nullable=false)
    public String getData() {
        return this.data;
    }
    
    public void setData(String data) {
        this.data = data;
    }
    
    @Column(name="name", nullable=false, length=16)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="time", nullable=false)
    public Long getTime() {
        return this.time;
    }
    
    public void setTime(Long time) {
        this.time = time;
    }
    
    @Column(name="type_id", nullable=false)
    public Long getTypeId() {
        return this.typeId;
    }
    
    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SystemSetting pojo = (SystemSetting) o;

        if (data != null ? !data.equals(pojo.data) : pojo.data != null) return false;
        if (name != null ? !name.equals(pojo.name) : pojo.name != null) return false;
        if (time != null ? !time.equals(pojo.time) : pojo.time != null) return false;
        if (typeId != null ? !typeId.equals(pojo.typeId) : pojo.typeId != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (data != null ? data.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (time != null ? time.hashCode() : 0);
        result = 31 * result + (typeId != null ? typeId.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("settingId").append("='").append(getSettingId()).append("', ");
        sb.append("data").append("='").append(getData()).append("', ");
        sb.append("name").append("='").append(getName()).append("', ");
        sb.append("time").append("='").append(getTime()).append("', ");
        sb.append("typeId").append("='").append(getTypeId()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
